﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SAPDfctPrdList.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.SAPModel.SAPDfctPrdList" %>

<%--SAP不良品清单管理--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="/MachineSys/EasyUI/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="/MachineSys/EasyUI/themes/icon.css" />
	<script type="text/javascript" src="/MachineSys/js/jquery-1.7.2.min.js"></script>   
	<script type="text/javascript" src="/MachineSys/EasyUI/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/MachineSys/EasyUI/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/MachineSys/EasyUI/easyui-formatter_20140718.js?v2"></script>
     <link href="/MachineSys/themes/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script src="/MachineSys/js/DWZ/jquery.autocomplete.js" type="text/javascript"></script>
    <script src="/MachineSys/js/DWZ/jquery.inputValue.js" type="text/javascript"></script>
    <script type="text/javascript">
        ///自适应宽高
        $(window).resize(function(){		    
            $("#tab_list").datagrid({
                width: '100%',
                height: $(parent.document).find(".tabsPageContent").height() - 11 > 0 ? $(parent.document).find(".tabsPageContent").height() - 11 : 500,
            }); 
        });

        $(document).ready(function () {
            //权限处理
            var $powers={
                "r查看":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.查看) %>,
                "r新增":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.新增) %>,
                "r修改":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.修改) %>,
                "r删除":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.删除) %>,
                "r导出":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.导出) %> 
                };
           

            //自动完成
            $(".autocomplete").each(function () {
                var $this = $(this);
                var url = unescape($this.attr("autocompletehref"));
                $this.autocomplete(url);
            });
            //条件查询
            $("#search-buttons").find("#btn_search").click(function () {
                var query = $("#tab_search").serializeJSON(); // GetInputData("tab_search", "query");
                query.action = "query";
                $('#tab_list').datagrid("options").queryParams = query;
                $('#tab_list').datagrid('load');
                $("#tab_search").dialog("close");
                return false;
            });

            var lastIndex;
            $('#tab_list').datagrid({               
                url: location.href,
                queryParams: { "action": "query" },
                width: '100%', //宽度    
                height: $(parent.document).find(".tabsPageContent").height() - 11 > 0 ? $(parent.document).find(".tabsPageContent").height() - 11 : 500,
                toolbar: "#tab_toolbar",
                rowStyler:function(index,row)
                {
                    if(row.Status=="已发")
                        return  "color:red;";  
                }               
            });   
        })

        
        //修改，通过工具栏
        function onEditClick(type) {

            var row = $('#tab_list').datagrid('getSelected')
            if (row == null) {
                $.messager.alert('提示', '请先选择要操作的记录');
                return false;
            }           

            var DfctID = row.DfctID;
            var rel = "SAPDfctPrdFctryEdit";
            var url = "SAPModel/SAPDfctPrdFctryEdit.aspx?DfctID=" + DfctID+"&action=add&TypeID="+type;
            var title = type==0?"出厂记录":"归还记录";
            var options = { width: 850, height: 455, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
          //  top.$.pdialog.open(url, rel, title, options);
             top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            return false;
        }
       

      
       
    </script>
     
</head>
<body style="margin:2px;" >
     <div id="tab_search" title="查询条件" style=" height:250px; width:500px;" class="easyui-dialog" modal="true" closed="true" buttons="#search-buttons">
        <table class="table_search" width="100%" style=" line-height:21px;">
            <tr>
                <td width="80px">物料号:</td>
                <td width="120px">               
                    <input  name="ItemCode"  />
                </td>
                <td width="80px">物料名称:</td>
                <td width="80px"> <input  name="Dscription"  /></td>
            </tr>
            <tr>
                <td >供应商:</td>
                 <td  >               
                    <input  name="CardName"  class="" />
                </td>
                <td>SAP转储单号:</td>
                 <td  >               
                    <input  name="DocNum"  class="" />
                </td>
                
            </tr>
          
        </table>
        <div id="search-buttons" style=" ">
            <a id="btn_search" href="javascript:;" class="easyui-linkbutton" iconcls="icon-search" plain="true">提交</a> 
            <a href="javascript:;" class="easyui-linkbutton" onclick="$('#tab_search').dialog('close');return false;" iconcls="icon-cancel" plain="true">取消</a>
        </div>
    </div>

    <div id="tab_toolbar" style="padding:2px;">
       <a href="#" title="高级查找" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="$('#tab_search').dialog('open');" Permission="">查找</a>
       
       <%if (HasPower(IHISCETeim.Web.Permission.修改) ){%> 
        <a href="#" title="出厂" class="easyui-linkbutton" iconcls="icon-save" plain="true" onclick="return　onEditClick(0);" Permission="r修改">出厂</a>
        <a href="#" title="归还" class="easyui-linkbutton" iconcls="icon-save" plain="true" onclick="return　onEditClick(1);" Permission="r修改">归还</a>
       <%} %>
        
    </div>   

   <table id="tab_list" sortName="DfctID" sortOrder="DESC" iconCls="" singleSelect="true" idField="DfctID"  nowrap="false" striped="true" collapsible="false" remoteSort="true"  toolbar="#tab_toolbar"  pagination="true" pageNumber="1" pageSize="<%=numPerPage %>"  pageList="<%=SetnumPerPage() %>" rownumbers="true" showFooter="false" url="">
		<thead>
			<tr>
                 <th field="DocNum" width="80" sortable="true">转储单号</th>
                <th field="CardName"  sortable="true" width="100px">供应商</th>
                <th field="TaxDate"   sortable="true" formatter="formatterdate" sortable="true">单据日期</th>
				<th field="ItemCode"  sortable="true">物料号</th>
				<th field="Dscription" >物料名称</th>
                <th field="Quantity"  sortable="true">不良品数量</th>
                 <th field="LvQuantity"  sortable="true">已出厂数量</th>
                 <th field="GetQuantity"  sortable="true">已归还数量</th>
                <th field="JrnlMemo" sortable="true">日记帐备注</th>			
               
			</tr>
		</thead>
	</table>
</body>
</html>
